.class Lcom/netease/newsreader/activity/VoteSubmit$4$3;
.super Ljava/lang/Thread;
.source "VoteSubmit.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/netease/newsreader/activity/VoteSubmit$4;->onClick(Landroid/view/View;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;


# direct methods
.method constructor <init>(Lcom/netease/newsreader/activity/VoteSubmit$4;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    .line 160
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 11

    .prologue
    const/4 v10, 0x1

    const/4 v9, 0x0

    .line 163
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-virtual {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/activity/MyApplication;

    .line 165
    .local v0, appdata:Lcom/netease/newsreader/activity/MyApplication;
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->access$8(Lcom/netease/newsreader/activity/VoteSubmit;)Ljava/lang/String;

    move-result-object v6

    iget-object v7, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v7}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v7

    invoke-static {v7}, Lcom/netease/newsreader/activity/VoteSubmit;->access$9(Lcom/netease/newsreader/activity/VoteSubmit;)Ljava/lang/String;

    move-result-object v7

    iget-object v8, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v8}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v8

    invoke-static {v6, v7, v8}, Lcom/netease/newsreader/rss/GetContent;->doVote(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;

    move-result-object v4

    .line 167
    .local v4, res:Ljava/lang/String;
    if-eqz v4, :cond_2

    .line 168
    :try_start_0
    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2, v4}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 169
    .local v2, obj:Lorg/json/JSONObject;
    if-eqz v2, :cond_0

    .line 170
    const-string v6, "result"

    invoke-virtual {v2, v6}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 171
    .local v3, r:Ljava/lang/String;
    const-string v6, "success"

    invoke-virtual {v6, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_1

    .line 174
    new-instance v5, Landroid/content/ContentValues;

    invoke-direct {v5}, Landroid/content/ContentValues;-><init>()V

    .line 175
    .local v5, values:Landroid/content/ContentValues;
    const-string v6, "vote_id"

    iget-object v7, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v7}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v7

    invoke-static {v7}, Lcom/netease/newsreader/activity/VoteSubmit;->access$4(Lcom/netease/newsreader/activity/VoteSubmit;)Lcom/netease/newsreader/bean/VoteBean;

    move-result-object v7

    invoke-virtual {v7}, Lcom/netease/newsreader/bean/VoteBean;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v5, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 176
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    iget-object v6, v6, Lcom/netease/newsreader/activity/VoteSubmit;->db:Landroid/database/sqlite/SQLiteDatabase;

    const-string v7, "vote_table"

    const/4 v8, 0x0

    invoke-virtual {v6, v7, v8, v5}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    .line 179
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->access$8(Lcom/netease/newsreader/activity/VoteSubmit;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v0, v6}, Lcom/netease/newsreader/activity/MyApplication;->setVoteId(Ljava/lang/String;)V

    .line 180
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->access$10(Lcom/netease/newsreader/activity/VoteSubmit;)Landroid/os/Handler;

    move-result-object v6

    const/4 v7, 0x0

    invoke-virtual {v6, v7}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 196
    .end local v2           #obj:Lorg/json/JSONObject;
    .end local v3           #r:Ljava/lang/String;
    .end local v5           #values:Landroid/content/ContentValues;
    :cond_0
    :goto_0
    return-void

    .line 183
    .restart local v2       #obj:Lorg/json/JSONObject;
    .restart local v3       #r:Ljava/lang/String;
    :cond_1
    const/4 v6, 0x0

    invoke-virtual {v0, v6}, Lcom/netease/newsreader/activity/MyApplication;->setVoteId(Ljava/lang/String;)V

    .line 184
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->access$10(Lcom/netease/newsreader/activity/VoteSubmit;)Landroid/os/Handler;

    move-result-object v6

    const/4 v7, 0x1

    invoke-virtual {v6, v7}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 191
    .end local v2           #obj:Lorg/json/JSONObject;
    .end local v3           #r:Ljava/lang/String;
    :catch_0
    move-exception v1

    .line 192
    .local v1, e:Lorg/json/JSONException;
    invoke-virtual {v0, v9}, Lcom/netease/newsreader/activity/MyApplication;->setVoteId(Ljava/lang/String;)V

    .line 193
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->access$10(Lcom/netease/newsreader/activity/VoteSubmit;)Landroid/os/Handler;

    move-result-object v6

    invoke-virtual {v6, v10}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 194
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0

    .line 188
    .end local v1           #e:Lorg/json/JSONException;
    :cond_2
    const/4 v6, 0x0

    :try_start_1
    invoke-virtual {v0, v6}, Lcom/netease/newsreader/activity/MyApplication;->setVoteId(Ljava/lang/String;)V

    .line 189
    iget-object v6, p0, Lcom/netease/newsreader/activity/VoteSubmit$4$3;->this$1:Lcom/netease/newsreader/activity/VoteSubmit$4;

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit$4;->access$0(Lcom/netease/newsreader/activity/VoteSubmit$4;)Lcom/netease/newsreader/activity/VoteSubmit;

    move-result-object v6

    invoke-static {v6}, Lcom/netease/newsreader/activity/VoteSubmit;->access$10(Lcom/netease/newsreader/activity/VoteSubmit;)Landroid/os/Handler;

    move-result-object v6

    const/4 v7, 0x1

    invoke-virtual {v6, v7}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method
